]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Wait for backgrounds to load, even when interrupted
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 12 Feb 2026 12:50:47 +0000 (13:50 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 3 Mar 2026 12:49:04 +0000 (12:49 +0000)
We no longer get stuck when a background manager is destroyed during
the startup animation, but we now resolve before the new backgrounds
have been loaded.

Address this by keeping the returned promise around until it is fulfilled,
and only resolve it after backgrounds were loaded successfully.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4070>

js/ui/layout.js

index 362598d3c966e9883a68a98d83bdd99b1864d5ca..b2d62f6caa18c67c51c02f4df0196b04d8afe895 100644 (file)
@@ -540,7 +540,7 @@ export const LayoutManager = GObject.registerClass({
         return promise;
     }
 
-    _updateBackgrounds() {
+    async _updateBackgrounds() {
         this._bgLoadCancellable?.cancel();
         this._bgLoadCancellable = null;
 
@@ -563,8 +563,19 @@ export const LayoutManager = GObject.registerClass({
                 bgManager.backgroundActor.hide();
         }
 
-        return Promise.all(
-            this._bgManagers.map(mgr => this._waitLoaded(mgr, cancellable)));
+        if (!this._updateBackgroundsResolvers)
+            this._updateBackgroundsResolvers = Promise.withResolvers();
+
+        const {promise, resolve} = this._updateBackgroundsResolvers;
+        try {
+            await Promise.all(
+                this._bgManagers.map(mgr => this._waitLoaded(mgr, cancellable)));
+
+            delete this._updateBackgroundsResolvers;
+            resolve();
+        } catch {}
+
+        return promise;
     }
 
     _updateKeyboardBox() {